<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            width: 500px;
            height: 500px;
            background-color: green;
            /* 1
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center; */
            /* 2
            position: relative; */
            /* 3
            overflow: hidden; */
        }
        
        .box {
            height: 100px;
            width: 100px;
            background-color: blue;
            /* 2
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%); */
            /* 3
            margin: 50% auto;
            transform: translateY(-50%); */
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="box"></div>
    </div>
</body>

</html>